*1988, 1992, 1996, 2000, 2004, 2008 and 2012*
*CPS American National Election Studies (ANES) Data*
*Note: The data examined here are from the ANES Cumulative File, which, as*
*of 09/14, has been updated to include data collected during and after the*
*2012 presidential election*

*This study examines the changing over time influence of core values — *
*specifically equality and morality — on the relationship between individuals'*
*ideological self-identifications and partisanship*

*The analysis conducted in this Stata do-file produces the tables and figures* 
*appearing in the BJPS article titled "Values and Political Predispositions* 
*in the Age of Polarization: Examining the Relationship between Partisanship* 
*and Ideology in the U.S., 1988-2012"*

*Specifically, the following analysis produces manuscript Table 1 and*
*Figures 1-5 — representing the one table and all of the figures appearing* 
*in the article — as well as Supporting Information (SI) Tables SI1-3 and SI*
*Figures SI3-6*

*The analysis conducted to produce Figures SI1-2 and SI7 appear* 
*in separate files within this Dataverse Dataset*

*This article is co-authored with Steven M. Smallpage and Adam M. Enders*
*My name is Robert N. Lupton, and I conducted the empirical analysis featured*
*in this Stata do-file

*Wed. 17 April 2013*
*Updated: Thurs. 9 May 2013*
*Updated: Sat. 11 May 2013*
*Updated: Mon. 13 May 2013*
*Updated: Tues. 14 May 2013*
*Updated: Wed. 15 May 2013*
*Updated: Friday 17 May 2013*
*Updated: Saturday 18 May 2013*
*Updated: Thurs. 23 May 2013*
*Updated: Mon. 7 April 2014*
*Updated: Wed. 9 April 2014*
*Updated: Wed. 7 May 2014*
*Updated: Friday 17 October 2014*
*Updated: Tues. 21 October 2014*
*Updated: Wed. 22 October 2014*
*Updated: Tues. 28 October 2014*
*Updated: Tues. 3 March 2015*
*Updated: Sun. 15 March 2015*
*Updated: Mon. 16 March 2015*
*Updated: Mon. 23 March 2015*
*Updated: Thurs. 23 April 2015*
*Updated: Sun. 26 April 2015*
*Updated: Mon. 27 April 2015*
*Updated: Wed. 29 April 2015*
*Updated: Mon. 14 September 2015*
*Updated: Thurs. 24 September 2015*
*Updated: Tues. 29 September 2015*
*Updated: Wed. 30 September 2015*
*Updated: Wed. 24 February 2016*
*Updated: Sat. 2 April 2016*
*Updated: Sun. 3 April 2016*
*Updated: Mon. 4 April 2016*
*Updated: Tues. 5 April 2016*
*Updated: Wed. 13 April 2016*
*Updated: Thurs. 14 April 2016*
*Updated: Friday 15 April 2016*
*Updated: Sat. 16 April 2016*
*Updated: Mon. 18 April 2016*
*Updated: Thurs. 21 April 2016*
*Updated: Mon. 24 October 2016*
*Updated: Wed. 26 October 2016*
*Updated: Mon. 14 November 2016*
*Updated: Tues. 04 April 2017*
*Updated: Wed. 05 April 2017*
*Updated: Wed. 12 April 2017*
*Updated: Thurs. 25 May 2017*
*Updated: Wed. 27 September 2017*

****************
*This analysis first requires that the researcher download the ANES Cumulative*
*File, 1948-2012, which I have uploaded as part of these materials as the*
*the following Stata Data file: "ANES Cumulative File (1948-2012).dta"
****************

set more off
set matsize 10000

****************
*Recode interview mode variable, as we will need this variable to conduct*
*subsequent analyses*

gen Surveymode = VCF0017
label var Surveymode ///
"Survey Mode" 
label define Surveymethod ///
0 "All personal" 1 "Telephone pre" 2 "Telephone post" 3 "All telephone" ///
4 "Internet (2012)"
label values Surveymode Surveymethod

****************
*Recode demographic control variables*

*Note: These variables will be included as control variables in the* 
*empirical analysis predicting partisanship*
****************

*Note: The race variable consists of four dummy variables: Whites, blacks,*
*Hispanics and other races*
*Whites will be the omitted reference category for the purpose* 
*of the empirical analysis

*Race*

gen White = .
replace White = 0 if VCF0105a == 2
replace White = 0 if VCF0105a == 5
replace White = 0 if VCF0105a == 3
replace White = 0 if VCF0105a == 4
replace White = 0 if VCF0105a == 6
replace White = 0 if VCF0105a == 7
replace White = 1 if VCF0105a == 1
label var White ///
"White"
label define Whites ///
0 "Non-white" 1 "Whites" 
label values White Whites

gen Black = .
replace Black = 0 if VCF0105a == 1
replace Black = 0 if VCF0105a == 3
replace Black = 0 if VCF0105a == 4
replace Black = 0 if VCF0105a == 5
replace Black = 0 if VCF0105a == 6
replace Black = 0 if VCF0105a == 7
replace Black = 1 if VCF0105a == 2
label var Black ///
"Black"
label define Blackrace  ///
0 "Non-black" 1 "Black"
label values Black Blackrace

gen Hispanic = .
replace Hispanic = 0 if VCF0105a == 1
replace Hispanic = 0 if VCF0105a == 2
replace Hispanic = 0 if VCF0105a == 3
replace Hispanic = 0 if VCF0105a == 4
replace Hispanic = 0 if VCF0105a == 6
replace Hispanic = 0 if VCF0105a == 7
replace Hispanic = 1 if VCF0105a == 5
label var Hispanic ///
"Hispanic"
label define Hispanicrace ///
0 "Non-Hispanic" 1 "Hispanic"
label values Hispanic Hispanicrace

gen Otherrace = .
replace Otherrace = 0 if VCF0105a == 1
replace Otherrace = 0 if VCF0105a == 2
replace Otherrace = 0 if VCF0105a == 5
replace Otherrace = 1 if VCF0105a == 3
replace Otherrace = 1 if VCF0105a == 4
replace Otherrace = 1 if VCF0105a == 6
replace Otherrace = 1 if VCF0105a == 7
label var Otherrace ///
"Other races"
label define Otherraces ///
0 "White, black or Hispanic" 1 "Otherrace" 
label values Otherrace Otherraces

*Gender*

gen Gender = VCF0104
replace Gender = . if VCF0104 == 0
replace Gender = 0 if VCF0104 == 1
replace Gender = 1 if VCF0104 == 2
label var Gender ///
"Respondent Gender"
label define Sex 0 "0 Male" 1 "1 Female"
label values Gender Sex

*Age*

gen Age = VCF0101
replace Age = . if VCF0101 == 00
replace Age = . if VCF0101 == 97
replace Age = . if VCF0101 == 99
label var Age "Respondent Age"

*Education*

gen Education = VCF0110
replace Education = . if VCF0110 == 0
label var Education ///
"Respondent's Education"
label define Educationlevel ///
1 "1 Less than high school" 2 "2 High school diploma" 3 "3 Some college" ///
4 "4 College or advanced degree"
label values Education Educationlevel

*Income*

gen Income = VCF0114
replace Income = . if VCF0114 == 0

*Union membership*

gen Union = VCF0127
replace Union = . if VCF0127 == 0
replace Union = 0 if VCF0127 == 2
label var Union ///
"Union Member in the Household"
label define Unionhousehold ///
0 "0 No union member" 1 "1 Union member"
label values Union Unionhousehold

*Marital status*

gen Married = VCF0147
replace Married = . if VCF0147 == 9
replace Married = 0 if VCF0147 == 2
replace Married = 0 if VCF0147 == 3
replace Married = 0 if VCF0147 == 4
replace Married = 0 if VCF0147 == 5
replace Married = 0 if VCF0147 == 6
replace Married = 0 if VCF0147 == 7
replace Married = 0 if VCF0147 == 8
replace Married = 0 if VCF0147 == 9
label var Married ///
"Martial Status"
label define Marital ///
0 "0 Unmarried" 1 "1 Married"
label values Married Marital

****************
*Recode the region variable*

*Note: For the empirical analysis, "South" will be the omitted reference* 
*category for the purpose of the empirical analysis and compared to the*
*other regions (identified as "East," "Midwest" and "West," respectively)*
****************

*South*

gen South = .
replace South = 0 if VCF0112 == 1
replace South = 0 if VCF0112 == 2
replace South = 0 if VCF0112 == 4
replace South = 1 if VCF0112 == 3
label var South ///
"South Region Dummy"
label define Southern ///
0 "0 Non-South" 1 "1 South"
label values South Southern

****************
*Recode symbolic predispositions*
****************

*Party identification*

*Note: Partisanship runs from "Strong Democrat" (0)* 
*to "Strong Republican" (6), with "3" representing true political independents*
*We do not label the variable because it will be recoded to range* 
*from "0" to "1" in a supplemental analysis*

gen Partyid = VCF0301
replace Partyid = . if VCF0301 == 0
replace Partyid = 0 if VCF0301 == 1
replace Partyid = 1 if VCF0301 == 2
replace Partyid = 2 if VCF0301 == 3
replace Partyid = 3 if VCF0301 == 4
replace Partyid = 4 if VCF0301 == 5
replace Partyid = 5 if VCF0301 == 6
replace Partyid = 6 if VCF0301 == 7
label var Partyid ///
"Party Identification"

*Ideology*
*Note: For the purpose of this analysis investigating the importance of core*
*values for polarization, the traditional measure of liberal-conservative* 
*will be considered "symbolic ideology," reflecting the fact*
*that liberals and conservatives in the mass public might respond differently*
*to polarized elite cues*

*Note: Ideology runs from "extremely liberal" (0) to "extremely conservative"* 
*(6), with "3" representing ideological moderates, but we do not label* 
*the variable because it will be recoded to range from "0" to "1"*

gen Ideology = VCF0803
replace Ideology = . if VCF0803 == 0
replace Ideology = . if VCF0803 == 9
replace Ideology = 0 if VCF0803 == 1
replace Ideology = 1 if VCF0803 == 2
replace Ideology = 2 if VCF0803 == 3
replace Ideology = 3 if VCF0803 == 4
replace Ideology = 4 if VCF0803 == 5
replace Ideology = 5 if VCF0803 == 6
replace Ideology = 6 if VCF0803 == 7
label var Ideology ///
"Ideological Self-Identification"

*Recode ideology to range from "0" to "1"*

*Note: The variable is coded in this fashion so that all primary predictors*
*of interest range from zero to one, allowing for a clear comparison* 
*of effects*

replace Ideology = Ideology/6

*Crate a dummy variable capturing the proportion of individuals who*
*respond either "don't know" or "haven't thought about it much," a variable*
*that will be examined in a supplemental analysis*

*"Ideoldkn" is a dummy variable coded 0 if the respondent responds to the*
*ideological self-identification question either "don't know"*
*or "haven't thought about it much," and the variable is coded 1 if the*
*respondent ideologically self-identifies*

*Note: Thus, we deliberately maintain response option 9 of*
*"don't know" for the purpose of this analysis*

gen Ideoldkn = .
replace Ideoldkn = 0 if VCF0803 == 9
replace Ideoldkn = 1 if VCF0803 == 1
replace Ideoldkn = 1 if VCF0803 == 2
replace Ideoldkn = 1 if VCF0803 == 3
replace Ideoldkn = 1 if VCF0803 == 4
replace Ideoldkn = 1 if VCF0803 == 5
replace Ideoldkn = 1 if VCF0803 == 6
replace Ideoldkn = 1 if VCF0803 == 7

gen Libtherm = VCF0211
replace Libtherm = . if Libtherm >= 98

gen Conservtherm = VCF0212
replace Conservtherm = . if Conservtherm >= 98


gen Dempartytherm = VCF0218
replace Dempartytherm = . if Dempartytherm >= 98

gen Reppartytherm = VCF0224
replace Reppartytherm = . if Reppartytherm >= 98

gen Demcandtherm = VCF0424
replace Demcandtherm = . if Demcandtherm >= 98

gen Repcandtherm = VCF0426
replace Repcandtherm = . if Repcandtherm >= 98

****************
*Recode retrospective economic evaluations variable*

*Note: This economic evaluation measure will be included as a control variable*
*in the model predicting partisanship*
****************

*Retrospective economic evaluations (one year)*

*Note: The unlabeled category is ".5," which is unlabeled due to the fact that*
*STATA does not allow non-integer value labels*

*Note: The variable is coded in this fashion so that all primary predictors*
*of interest range from zero to one, allowing for a clear comparison* 
*of effects*

gen Retrospective = VCF0870
replace Retrospective = . if VCF0870 == 8
replace Retrospective = 0 if VCF0870 == 5
replace Retrospective = .5 if VCF0870 ==3
replace Retrospective = 1 if VCF0870 == 1
label var Retrospective ///
"Evaluation of the Economy over the Past Year"
label define Retrospectives ///
0 "0 Worse" 1 "1 Better"
label values Retrospective Retrospectives 

****************
*In response to an anonymous reviewer's fair point that we should account* 
*for the fact that economic retrospectives will relate differently* 
*to partisanship based upon the incumbent president's party, as well as* 
*to present these party control effects more clearly (we considered the* 
*fact in the initial manuscript draft, but this approach is superior),* 
*we create a variable capturing incumbent party status at the time* 
*of the election (and thus the survey)*

*Note: This variable is coded "0," indicating Republican control of the* 
*White House, in 1988, 1992, 2004 and 2008*
*This variable is thus coded "1," indicating Democratic control of the* 
*White House, in 1996, 2000 and 2012*

*Note: The ANES Cumulative File variable indicating election year is VCF0004*
****************

*Democratic incumbent president*

gen Dempres= .
replace Dempres = 0 if VCF0004 == 1988
replace Dempres = 0 if VCF0004 == 1992
replace Dempres = 0 if VCF0004 == 2004
replace Dempres = 0 if VCF0004 == 2008
replace Dempres = 1 if VCF0004 == 1996
replace Dempres = 1 if VCF0004 == 2000
replace Dempres = 1 if VCF0004 == 2012
label var Dempres "Democratic Incumbent President"
label define Democraticpresident ///
0 "Republican president" 1 "Democratic president"
label values Dempres Democraticpresident

****************
*Create a multiplicative interaction term involving the retrospective*
*economic evaluations variable and the Democratic incumbent president variable*
*that will be included in our main regression models*

*Note: The constitutive economic retrospective evaluations term can now*
*be interpreted as the influence of economic assessments on partisanship*
*when a Republican is the incumbent president, and the interaction term*
*captures the same effect when a Democrat is the incumbent president*
*The constitutive Democratic president term is the effect of an individual's*
*belief that the economy has worsened when a Democrat occupies the White House*
****************

*Creating an interaction term to capture the conditional effects* 
*of presidential control on retrospective economic evaluations*

gen Retdem = Retrospective*Dempres

****************
*Incorporate a religiosity variable into the model in response*
*to an anonymous reviewer's astute (not being sarcastic) point that any model* 
*predicting* partisanship should include a measure of biblical literalism*

*Specifically, we follow Layman (1997) by creating a two-item scale of* 
*religiosity using the biblical literalism and frequency of church attendance*
*measures*
****************

*Biblical literalism*
*Note: This variable is reverse coded such that higher values indicate greater*
*greater religiosity*

*Note: The series for ANES Cumulative File variable VCF0845 was discontinued* 
*in 1988, meaning that this variable is constructed from both VCF0845 and*
*VCF0850 for the years 1992-2012*

*Note: The number of response categories differ across the two variables,* 
*which is why the two most "liberal" categories are combined in 1988*

gen Biblit = .
replace Biblit = 0 if VCF0845 == 3 & VCF0004 == 1988
replace Biblit = 0 if VCF0845 == 4 & VCF0004 == 1988
replace Biblit = 0 if VCF0850 == 3
replace Biblit = 1 if VCF0850 == 2
replace Biblit = 1 if VCF0845 == 2 & VCF0004 == 1988
replace Biblit = 2 if VCF0845 == 1 & VCF0004 == 1988
replace Biblit = 2 if VCF0850 == 1
label var Biblit "Biblical Literalism"

*Note: The categories for the biblical literalism variable in 1988 (VCF0845)* 
*are as follows*

*0 "The Bible was written by men who lived so long ago that it is worth very little today"
*0 "The Bible is a good book because it wass written by wise men, but God had nothing to do with it"
*1 "The Bible was written by men inspired by God but it contains some human errors"
*2 "The Bible is God's word and all that it says is true"

*Note: The categories for the biblical literalism variable for the years* 
*1992-2012 (VCF0850) are as follows:*

*0 "The Bible is a book written by men and is not the word of God"
*1 "The Bible is the word of God but not everything in it should be taken literally, word for word"
*2 "The Bible is the actual word of God and is to be taken literally, word for word"

*Recode the biblical literalism variable to range between 0 and 1*

replace Biblit = Biblit/2

*Church attendance*
*Note: This variable is reverse coded such that higher values indicate greater*
*greater religiosity*

gen Churchattend = VCF0130
replace Churchattend = . if VCF0130 == 0
replace Churchattend = . if VCF0130 == 7
replace Churchattend = . if VCF0130 == 8
replace Churchattend = . if VCF0130 == 9
replace Churchattend = 0 if VCF0130 == 5
replace Churchattend = 1 if VCF0130 == 4
replace Churchattend = 2 if VCF0130 == 3
replace Churchattend = 3 if VCF0130 == 2
replace Churchattend = 4 if VCF0130 == 1
label var Churchattend "Church Attendance"

*Note: The categories for the church attendance variable are as follows*

*0 "Never"
*1 "A few times a year" 
*2 "Once or twice a month"
*3 "Almost every week" 
*4 "Every week"

*Recode the Church attendance variable to range between 0 and 1*

replace Churchattend = Churchattend/4

*Create a religiosity scale comprised of the above two measures*

alpha Biblit Churchattend, detail item generate(Religiosity)

****************
*Create a time variable that will be interacted with ideology and core values*
*in order to assess the potentially changing over time influence of ideology*
*on partisanship conditioned on core values*
*This three-way interaction will serve as the primary empirical relationship*
*of interest in the manuscript*

*Note: The time variable is in indicator of partisan polarization and* 
*begins in 1988 because 1988 was the first year*
*in which the moral traditionalism battery was included on the ANES*
*Thus, the time variable takes a value of "0" in 1988 and "6" in 2012*
****************

*Time*

gen Time = .
replace Time = 0 if VCF0004 == 1988
replace Time = 1 if VCF0004 == 1992
replace Time = 2 if VCF0004 == 1996
replace Time = 3 if VCF0004 == 2000
replace Time = 4 if VCF0004 == 2004
replace Time = 5 if VCF0004 == 2008
replace Time = 6 if VCF0004 == 2012

****************
*Drop all years that will be not be used in the empirical analysis, which*
*includes all years prior to 1988, as well as the midterm election years of*
*1990, 1994, 1996, 1998 and 2002 (note: no ANES Time Series Study was*
*conducted in either 2006 or 2010, unfortunately)*
****************

drop if Time == .

****************
*Recode values variables*

*Note: The ten individual questions comprising the two longest running ANES* 
*batteries of core values, egalitarianism (six questions) and moral* 
*traditionalism (four questions), will be combined into a single scale*
*ranging from zero to one in this analysis*

*Note: The resulting scale will serve as the primary independent variable* 
*of interest in the empirical analysis testing the potentially changing* 
*over time influence of core values on the relationship* 
*between individuals' ideological self-identification and partisanship*
****************

****************
*Recode egalitarianism variables*

*Note: The equal opportunity, equal rights, less equal and unequal variables* 
*are all reverse coded so that higher values indicate* 
*more conservative attitudes*
****************

*Do whatever is necessary for equal opportunity*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*

gen Equalopp = VCF9013
replace Equalopp = . if VCF9013 == 8 
replace Equalopp = . if VCF9013 == 9
replace Equalopp = 0 if VCF9013 == 1
replace Equalopp = 1 if VCF9013 == 2
replace Equalopp = 2 if VCF9013 == 3
replace Equalopp = 3 if VCF9013 == 4
replace Equalopp = 4 if VCF9013 == 5
label var Equalopp /// 
"Our Society Should Do What is Necessary to Ensure Equal Opportunity"
label define Equalopportunity ///
0 "0 Agree strongly" 1 "1 Agree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Disagree somewhat" 4 "4 Disagree strongly"
label values Equalopp Equalopportunity

*Have gone too far pushing equal rights
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*

gen Equalrights = VCF9014
replace Equalrights = . if VCF9014 == 8
replace Equalrights = . if VCF9014 == 9
replace Equalrights = 0 if VCF9014 == 5
replace Equalrights = 1 if VCF9014 == 4
replace Equalrights = 2 if VCF9014 == 3
replace Equalrights = 3 if VCF9014 == 2
replace Equalrights = 4 if VCF9014 == 1
label var Equalrights "We Have Gone Too Far Pushing Equal Rights"
label define Equalrightspush ///
0 "0 Disagree strongly" 1 "1 Disagree somewhat" /// 
2 "2 Neither agree nor disagree" 3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Equalrights Equalrightspush

*Big problem is not giving everyone an equal chance*

gen Equalchance = VCF9015
replace Equalchance = . if VCF9015 == 8
replace Equalchance = . if VCF9015 == 9
replace Equalchance = 0 if VCF9015 == 1
replace Equalchance = 1 if VCF9015 == 2
replace Equalchance = 2 if VCF9015 == 3
replace Equalchance = 3 if VCF9015 == 4
replace Equalchance = 4 if VCF9015 == 5
label var Equalchance /// 
"One of the Big Problems in this Country is Not Giving Everyone an Equal Chance"
label define Equalchances /// 
0 "0 Agree strongly" 1 "1 Agree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Disagree somewhat" 4 "4 Disagree strongly"
label values Equalchance Equalchances

*Not that big of a problem if people have more of a chance*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*

gen Unequal = VCF9016
replace Unequal = . if VCF9016 == 8
replace Unequal = . if VCF9016 == 9
replace Unequal = 0 if VCF9016 == 5 
replace Unequal = 1 if VCF9016 == 4 
replace Unequal = 2 if VCF9016 == 3 
replace Unequal = 3 if VCF9016 == 2 
replace Unequal = 4 if VCF9016 == 1 
label var Unequal /// 
"It Is Not That Big of a Problem if Some People Have More of a Chance in Life"
label define Unequalchance ///
0 "0 Disagree strongly" 1 "1 Disagree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Unequal Unequalchance

*Better off if we worried less about equality*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*

gen Lessequal = VCF9017
replace Lessequal = . if VCF9017 == 8
replace Lessequal = . if VCF9017 == 9
replace Lessequal = 0 if VCF9017 == 5
replace Lessequal = 1 if VCF9017 == 4
replace Lessequal = 2 if VCF9017 == 3
replace Lessequal = 3 if VCF9017 == 2
replace Lessequal = 4 if VCF9017 == 1
label var Lessequal ///
"This Country Would Be Better Off if We Worried Less about Equality"
label define Lessequality ///
0 "0 Disagree strongly" 1 "1 Disagree somewhat" /// 
2 "2 Neither agree nor disagree" 3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Lessequal Lessequality

*Many fewer problems if people were treated equally*

gen Fewer = VCF9018
replace Fewer = . if VCF9018 == 8
replace Fewer = . if VCF9018 == 9
replace Fewer = 0 if VCF9018 == 1
replace Fewer = 1 if VCF9018 == 2
replace Fewer = 2 if VCF9018 == 3
replace Fewer = 3 if VCF9018 == 4
replace Fewer = 4 if VCF9018 == 5
label var Fewer /// 
"If People Were Treated More Equally in this Country We Would Have Many Fewer Problems"
label define Treatequally ///
0 "0 Agree strongly" 1 "1 Agree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Disagree somewhat" 4 "4 Disagree strongly"
label values Fewer Treatequally

****************
*Recode moral traditionalism variables*

*Note: The lifestyles and family variables are reverse coded so that higher* 
*values indicate more conservative attitudes*
****************

*Newer lifestyles contributing to a breakdown in society*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*
 
gen Lifestyles = VCF0851
replace Lifestyles = . if VCF0851 == 8
replace Lifestyles = . if VCF0851 == 9
replace Lifestyles = 0 if VCF0851 == 5
replace Lifestyles = 1 if VCF0851 == 4
replace Lifestyles = 2 if VCF0851 == 3
replace Lifestyles = 3 if VCF0851 == 2
replace Lifestyles = 4 if VCF0851 == 1
label var Lifestyles /// 
"Newer Lifestyles are Contributing to the Breakdown of Society"
label define Lifestylesnew ///
0 "0 Disagree strongly" 1 "1 Disagree somewhat" /// 
2 "2 Neither agree nor disagree"  3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Lifestyles Lifestylesnew

*Adjusting views of moral behavior*

gen Changing = VCF0852
replace Changing = . if VCF0852 == 8
replace Changing = . if VCF0852 == 9
replace Changing = 0 if VCF0852 == 1
replace Changing = 1 if VCF0852 == 2
replace Changing = 2 if VCF0852 == 3
replace Changing = 3 if VCF0852 == 4
replace Changing = 4 if VCF0852 == 5
label var Changing /// 
"We Should Adjust our Views of Moral Behavior to Changes in Society"
label define Changingmorals 0 "Agree strongly" 1 "Agree somewhat" /// 
2 "Neither agree nor disagree" 3 "Disagree somewhat" 4 "Disagree strongly"
label values Changing Changingmorals

*More emphasis on traditional family ties*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*
 
gen Family = VCF0853
replace Family = . if VCF0853 == 8
replace Family = . if VCF0853 == 9
replace Family = 0 if VCF0853 == 5
replace Family = 1 if VCF0853 == 4
replace Family = 2 if VCF0853 == 3
replace Family = 3 if VCF0853 == 2
replace Family = 4 if VCF0853 == 1
label var Family /// 
"This Country Would Have Many Fewer Problems if There Were More Emphasis on Traditional Family Ties"
label define Familyties /// 
0 "0 Disagree strongly" 1 "1 Disagree somewhat" /// 
2 "2 Neither agree nor disagree"  3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Family Familyties
 
*Tolerant of people who choose to live according to their own moral standards*

gen Standards = VCF0854
replace Standards = . if VCF0854 == 8
replace Standards = . if VCF0854 == 9
replace Standards = 0 if VCF0854 == 1
replace Standards = 1 if VCF0854 == 2
replace Standards = 2 if VCF0854 == 3
replace Standards = 3 if VCF0854 == 4
replace Standards = 4 if VCF0854 == 5
label var Standards /// 
"We Should Be More Tolerant of People Who Choose to Live According to Their Own Moral Standards"
label define Standardsown ///
0 "0 Agree strongly" 1 "1 Agree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Disagree somewhat" 4 "4 Disagree strongly"
label values Standards Standardsown

****************
*Create a single core values scale that incorporates the ten items from the*
*egalitarianism and moral traditionalism batteries*

*Note: Again, this scale will serve as the primary independent variable* 
*of interest in the empirical analysis testing the potentially changing* 
*over time influence of core values on the relationship* 
*between ideology and partisanship conditioned on core values*  
****************

alpha Equalopp Equalrights Equalchance Unequal Lessequal Fewer /// 
Lifestyles Changing Family Standard, detail item generate (Valuesscale) /// 
casewise

*Recode the core values scale to range from zero to one, per the standard
*in the literature*

gen Valueorientations = Valuesscale/4

*Issue a command to preserve only the recoded variables that will be used in*
*this analysis*

keep Surveymode-Valueorientations

*These data are now saved as a Stata data file titled*
*"Values, Ideology and Partisanship, 1988-2012.data"*

****************
*Estimate the correlation between respondents' ideological and partisan*
*self-identifications for the years 1988-2012*

*Note: The command "corrci" also produces 95% confidence intervals for each*
*estimate, but the package must first be installed before the analysis*
*can be conducted*

*Note: The command can be installed by typing "findit corrci"*
****************

corrci Ideology Partyid if Time == 0

corrci Ideology Partyid if Time == 1

corrci Ideology Partyid if Time == 2

corrci Ideology Partyid if Time == 3

corrci Ideology Partyid if Time == 4

corrci Ideology Partyid if Time == 5

corrci Ideology Partyid if Time == 6

****************
*The following code creates a dot plot featuring the correlation between*
*ideological and partisan self-identifications for the full mass public*
*sample for the years 1988-2012*

*Note: The data used to produce this code is contained in the Stata data file*
*titled "Correlation between Ideology and Partisanship (1988-2012 ANES).dta"*
*The code used to produce the estimates contained in the above file can be*
*obtained using the code located immediately above in this do file*

*Note: The following code uses the aforementioned Stata data file to produce* 
*article Figure 1*

*Note: The "0" that appears before the numbers on the y-axis were added*
*only after the manuscript was conditionally accepted for publication*
****************	  	

twoway  (scatter IdeolpidEST n in 1/7, mcolor(black) msymbol(circle) /// 
        mfcolor (black) msize(medium)) /// 
        (rspike IdeolpidLOW IdeolpidHIGH n in 1/7, vertical lcolor(black) /// 
        lwidth(thin)), ///
        legend(off) ///
	  	graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
	    plotregion(lcolor(black)) graphregion(margin(medsmall)) /// 
	  	aspectratio(.67) ///
	    xlabel(1 "1988" 2 "1992" 3 "1996"  4 "2000" 5 "2004" 6 "2008" ///
		7 "2012", /// 
		labsize(small)) ///
		xtitle(" ") ///
		xscale(range(.8 7.2)) ///
		ylabel(,format (%9.1f)) ///
		ylabel(.3(.1).7, labsize(small) nogrid) ///
	    ytitle("Correlation Coefficient", size(medsmall)) 
	    
****************
*Now estimate the correlation between respondents' ideological and partisan*
*self-identifications for the years 1988-2012 conditioned on core values*
*in order to test our ideological asymmetry argument*

*Note: In order to estimate the desired correlation separately for individuals* 
*with liberal and conservative core value orientations, we define*
*"liberal value orientations" as those that are one standard deviation* 
*below (i.e., more liberal than) the mean of the value orientations scale*
*Similarly, "conservative value orientations" are defined as those that* 
*are one standard deviation above (i.e., more conservative than) the mean* 
*of the value orientations scale*
****************

*Determine the relative cutoffs used to define liberal and conservative core*
*value orientations*

summarize Valueorientations

*We observe that the mean of the value orientations variable is .4639803, and*
*the standard deviation is .1706797*

*Calculate liberal and conservative value orientations*

di .4639803 - .1706797

di .4639803 + .1706797

****************
*Estimate correlations between ideological and partisan self-identifications*
*for individuals with liberal value orientations for each year, 1988-2012*
****************

corrci Ideology Partyid if Time == 0 & Valueorientations < .293

corrci Ideology Partyid if Time == 1 & Valueorientations < .293

corrci Ideology Partyid if Time == 2 & Valueorientations < .293

corrci Ideology Partyid if Time == 3 & Valueorientations < .293

corrci Ideology Partyid if Time == 4 & Valueorientations < .293

corrci Ideology Partyid if Time == 5 & Valueorientations < .293

corrci Ideology Partyid if Time == 6 & Valueorientations < .293

****************
*Estimate correlations between ideological and partisan self-identifications*
*for individuals with conservative value orientations*
****************

corrci Ideology Partyid if Time == 0 & Valueorientations > .635

corrci Ideology Partyid if Time == 1 & Valueorientations > .635

corrci Ideology Partyid if Time == 2 & Valueorientations > .635

corrci Ideology Partyid if Time == 3 & Valueorientations > .635

corrci Ideology Partyid if Time == 4 & Valueorientations > .635

corrci Ideology Partyid if Time == 5 & Valueorientations > .635

corrci Ideology Partyid if Time == 6 & Valueorientations > .635

****************
*The following code creates a dot plot featuring the correlation between*
*ideological and partisan self-identifications for the mass public conditioned*
*on core values for the years 1988-2012*

*Note: The data used to produce this code is contained in the Stata data file*
*titled "Correlation between Ideology and Partisanship Conditioned on Core Values (1988-2012 ANES).dta"*
*The code used to produce the estimates contained in the above file can be*
*obtained using the code located immediately above in this do file*

*Note: The following code produces article Figure 2*

*Note: The "0" that appears before the numbers on the y-axis were added*
*only after the manuscript was conditionally accepted for publication*
****************	  	

twoway  (scatter IdeolpidconEST n in 1/7, mcolor(black) msymbol(circle) /// 
        msize(medium)) /// 
        (rspike IdeolpidconLOW IdeolpidconHIGH n in 1/7, ///
        vertical lcolor(black) /// 
        lwidth(thin) legend(order(1 "Conservative value orientations" ///
        3 "Liberal value orientations")) /// 
        legend(pos(6)col(1)) legend(symysize(*.5)) legend(symxsize(*.5)) /// 
        legend(size(small))) ///
		(scatter IdeolpidlibEST n in 1/7, mcolor(black) msymbol(circle) /// 
		mfcolor(white) msize(medium)) ///
		(rspike IdeolpidlibLOW IdeolpidlibHIGH n in 1/7, /// 
		vertical lcolor(black) lwidth(thin)), ///
	  	graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
	    plotregion(lcolor(black))graphregion(margin(medsmall)) /// 
	  	aspectratio(.67) ///
	    xlabel(1 "1988"  2 "1992" 3 "1996"  4 "2000" 5 "2004" 6 "2008" ///
		7 "2012", /// 
		labsize(small)) ///
		xtitle(" ") ///
		xscale(range(.8 7.2)) ///
	    ylabel(,format (%9.1f)) ///
		ylabel(.1(.1).7, labsize(small) nogrid) ///
	    ytitle("Correlation Coefficient", size(medsmall)) 

****************
*Please note that reopening the data saved as the Stata Data file*
*"Values, Ideology and Partisanship, 1988-2012.data" is required to complete*
*the remainder of the empirical analysis unless otherwise noted*
****************
 
****************
*Regress the partisanship variable ranging from zero to six on ideology,* 
*year, the core values scale, the interaction between ideology, the core* 
*values scale and year, retrospective economic evaluations, the interaction*
*between retrospective economic evaluations and Democratic control of the*
*White House, the religiosity scale and demographic control variables*

*Note: The primary empirical quantity of interest is the three-way interaction* 
*between ideology, the core values scale and the time variable, which assesses* 
*the potentially changing over time influence of ideology on partisanship*
*conditioned on core values*

*Note: The following code produces article Table 1*
****************

regress Partyid c.Ideology##c.Time##c.Valueorientations Retrospective ///
Retdem Dempres Religiosity Black Hispanic Otherrace Gender Age Education /// 
Income Married Union South

****************
*Estimate the marginal effect of ideology on partisanship over time*
*(i.e., across the time variable from 1988 (0) to 2012 (6), a total*
*of seven election years) conditioned on core values*

*Note: For this analysis, the potentially changing over time influence of*
*ideology on partisanship conditioned on core values is assessed* 
*for individuals who score one standard deviation below (.293) and above the* 
*mean (.635) on the core values scale*

*Specifically, the following code estimates the marginal effect* 
*of ideology on partisanship across time (1988-2012) for individuals* 
*with liberal (.293) and conservative value orientations (.635) separately*

*Note: The increments of ".01" for the "Time" variable are used in order* 
*to simulate "rarea" confidence intervals when in fact we are creating* 
*"rspike" confidence intervals, which allow us to prevent the confidence* 
*intervals for one group from completely eclipsing those for the other group* 
*in the early years of the analysis*
*We thank Shane P. Singh for providing us with this helpful hint*

*The good Stata folks should correct this glitch that affects "rarea"* 
*confidence intervals in three-way interaction plots*

*Note: The following code produces article Figure 3*
****************

margins, dydx(Ideology) at(c.Valueorientations=(.293(.342).635) ///
c.Time=(0(.01)6))

****************
*Create a marginal effects plot illustrating graphically the results obtained* 
*in the previous step of the analysis*
****************

marginsplot, recast(line) recastci(rspike) plot1opts(lcolor(black) ///
lpattern(dash)) ///
plot2opts(lcolor(black) lpattern(solid)) ///
ci1opts(color(navy) lwidth(vthin)) ///  
ci2opts(color(maroon) lwidth(vthin)) ///
xdimension(Time) aspectratio(.67) ///
legend(order(4 "Conservative value orientations" ///
3 "Liberal value orientations")) /// 
legend(pos(6)col(1)) legend(symysize(*.5)) legend(symxsize(*.5)) /// 
legend(size(small)) ///
graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
plotregion(lcolor(black))graphregion(margin(medsmall)) /// 
xlabel(0 "1988" 1 "1992" 2 "1996" 3 "2000" 4 "2004" 5 "2008" 6 "2012", ///
labsize(medsmall)) ///
xtitle("", size(medsmall)) ///
xscale(range(.9 6.1)) ///
ylabel (2.5(.5)4.5, labsize(medsmall) nogrid) ///
ytitle("M.E. of Ideology on Partisanship Conditioned on Values", /// 
size(small)) ///
title("")

****************
*Estimate the three-way interaction involving ideology, partisanship and*
*elite polarization (rather than time, which is used in the main analysis as* 
*a proxy for elite polarization)*

*Note: This analysis substitutes time for a more direct measure of elite*
*polarization, captured by the difference between the estimated House*
*Democratic and Republican DW-NOMINATE party medians in the years that we* 
*analyze*
*The measures are the estimated difference for the 100th, 102nd, 104th, 106th,*
*108th, 110th and 112th Congresses*
*The estimates were all obtained from Keith Poole's amazing Voteview website,* 
*the address for which is as follows: http://voteview.com/pmediant.htm*

*Note that we elevated this analysis from the Appendix to the main*
*body of manuscript text based on an anonymous reviewer's suggestion and the*
*Editor's concurrence*

*The following code thus produces what is now article Figure 4*
****************

gen Polarization = .
replace Polarization = .662 if Time == 0
replace Polarization = .667 if Time == 1
replace Polarization = .822 if Time == 2
replace Polarization = .864 if Time == 3
replace Polarization = .930 if Time == 4
replace Polarization = .982 if Time == 5
replace Polarization = 1.109 if Time == 6

regress Partyid c.Ideology##c.Polarization##c.Valueorientations /// 
Retrospective Retdem Dempres Religiosity Black Hispanic Otherrace Gender ///
Age Education Income Married Union South

****************
*Obtain the marginal effect of ideology on partisanship over time*
*(i.e., across the polarization variable from the 100th Congress (.662) to the*
*112th Congress (1.109), corresponding to the years included in our analysis)* 
*conditioned on core values*

*Note: For this analysis, the potentially changing over time influence of*
*ideology on partisanship conditioned on core values is again assessed* 
*for individuals who score one standard deviation below (.293) and above the* 
*mean (.635) on the core values scale*
****************

margins, dydx(Ideology) at(c.Valueorientations = (.293(.342).635) ///
c.Polarization=(.62(.0009)1.109))

****************
*Create a marginal effects plot illustrating graphically the results obtained* 
*in the previous step of the analysis*
****************

marginsplot, recast(line) plot1opts(lcolor(black) lpattern(dash)) ///
ci1opts(color(navy) lwidth(vthin)) ///  
ci2opts(color(maroon) lwidth(vthin)) ///
plot2opts(lcolor(black) lpattern(solid)) recastci(rspike) ///
xdimension(Polarization) aspectratio(1) ///
legend(order(4 "Conservative value orientations" ///
3 "Liberal value orientations")) /// 
legend(pos(6)col(1)) legend(symysize(*.5)) legend(symxsize(*.5)) /// 
legend(size(small)) ///
graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
plotregion(lcolor(black))graphregion(margin(medsmall)) /// 
xtitle("Polarization", size(medsmall)) ///
xlabel(,format (%9.1f)) ///
xscale(range(.6(.02)1.12)) ///
ylabel (2.5(.5)4.5, labsize(medsmall) nogrid) ///
ytitle("M.E. of Ideology on Partisanship Conditioned on Values", /// 
size(small)) ///
title("")

****************	  	
*Here, we display the partial correlations between ideology and*
*partisanship for each year, 1988-2012, across value orientations and time,* 
*controlling for other factors, in order to highlight the associational,* 
*as opposed to causal, nature of our empirical analysis*

*Note: This information originally appeared as Figure SI4, but we have*
*elevated the figure into the main body of text as manuscript Figure 5*

*Note: In order to include confidence intervals around our estimated partial*
*correlations, we adopt the following regression approach to calculating*
*partial correlations*
****************

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 0 & Valueorientations < .293 & Ideology != .
predict res011, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 0 & Valueorientations < .293 & Partyid != .
predict res012, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 0 & Valueorientations > .635 & Ideology != .
predict res021, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 0 & Valueorientations > .635 & Partyid != .
predict res022, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 1 & Valueorientations < .293 & Ideology != .
predict res111, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 1 & Valueorientations < .293 & Partyid != .
predict res112, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 1 & Valueorientations > .635 & Ideology != .
predict res121, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 1 & Valueorientations > .635 & Partyid != .
predict res122, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 2 & Valueorientations < .293 & Ideology != .
predict res211, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 2 & Valueorientations < .293 & Partyid != .
predict res212, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 2 & Valueorientations > .635 & Ideology != .
predict res221, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 2 & Valueorientations > .635 & Partyid != .
predict res222, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 3 & Valueorientations < .293 & Ideology != .
predict res311, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 3 & Valueorientations < .293 & Partyid != .
predict res312, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 3 & Valueorientations > .635 & Ideology != .
predict res321, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 3 & Valueorientations > .635 & Partyid != .
predict res322, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 4 & Valueorientations < .293 & Ideology != .
predict res411, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 4 & Valueorientations < .293 & Partyid != .
predict res412, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 4 & Valueorientations > .635 & Ideology != .
predict res421, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 4 & Valueorientations > .635 & Partyid != .
predict res422, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 5 & Valueorientations < .293 & Ideology != .
predict res511, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 5 & Valueorientations < .293 & Partyid != .
predict res512, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 5 & Valueorientations > .635 & Ideology != .
predict res521, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 5 & Valueorientations > .635 & Partyid != .
predict res522, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 6 & Valueorientations < .293 & Ideology != .
predict res611, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 6 & Valueorientations < .293 & Partyid != .
predict res612, res

reg Partyid Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 6 & Valueorientations > .635 & Ideology != .
predict res621, res

reg Ideology Retrospective Retdem Dempres /// 
	Religiosity Black Hispanic Otherrace Gender Age Education Income ///
	Married Union South if Time == 6 & Valueorientations > .635 & Partyid != .
predict res622, res	

*Estimate the correlations based on the above regression estimates*
	
corrci res011 res012 if Time == 0 & Valueorientations < .293
corrci res021 res022 if Time == 0 & Valueorientations > .635		
	
corrci res111 res112 if Time == 1 & Valueorientations < .293
corrci res121 res122 if Time == 1 & Valueorientations > .635		
	
corrci res211 res212 if Time == 2 & Valueorientations < .293
corrci res221 res222 if Time == 2 & Valueorientations > .635		
	
corrci res311 res312 if Time == 3 & Valueorientations < .293
corrci res321 res322 if Time == 3 & Valueorientations > .635		
	
corrci res411 res412 if Time == 4 & Valueorientations < .293
corrci res421 res422 if Time == 4 & Valueorientations > .635		

corrci res511 res512 if Time == 5 & Valueorientations < .293
corrci res521 res522 if Time == 5 & Valueorientations > .635	
	
corrci res611 res612 if Time == 6 & Valueorientations < .293
corrci res621 res622 if Time == 6 & Valueorientations > .635

****************
*Create a partial correlation plot calculated from the estimates generated* 
*by the above code*
*Note: The data are stored in a Stata data file titled*
*"Partial Correlations between Partisanship and Ideology Conditioned on Values, with Confidence Intervals (1988-2012 ANES).dta"*
****************

twoway  (scatter LIBest n in 1/7, mcolor(black) msymbol(circle) /// 
        msize(medium)) /// 
        (rspike LIBlower LIBupper n in 1/7, ///
        vertical lcolor(black) /// 
        lwidth(thin) legend(order(1 "Conservative value orientations" ///
        3 "Liberal value orientations")) /// 
        legend(pos(6)col(1)) legend(symysize(*.5)) legend(symxsize(*.5)) /// 
        legend(size(small))) ///
		(scatter CONSERVlower n in 1/7, mcolor(black) msymbol(circle) /// 
		mfcolor(white) msize(medium)) ///
		(rspike CONSERVlower CONSERVupper n in 1/7, /// 
		vertical lcolor(black) lwidth(thin)), ///
	  	graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
	    plotregion(lcolor(black))graphregion(margin(medsmall)) /// 
	  	aspectratio(.67) ///
	    xlabel(1 "1988"  2 "1992" 3 "1996"  4 "2000" 5 "2004" 6 "2008" ///
		7 "2012", /// 
		labsize(small)) ///
		xtitle(" ") ///
		xscale(range(.8 7.2)) ///
	    ylabel(,format (%9.1f)) ///
		ylabel(.1(.2).7, labsize(small) nogrid) ///
	    ytitle("Correlation Coefficient", size(medsmall)) 
		
****************
*Online appendix*
*Supporting information (SI)*

*Note: Most of the results of the following analysis appear in the article's*
*supplemental online appendix, and the results of any analysis that does*
*not appear there is of course available upon request*
****************

****************	  	
*Assess the proportion of "don't know' responses to the ideological*
*self-identification question for the period we investigate (1988-2012)*

*Note: We are analyzing here the "Ideoldkn" variable that we constructed*
*near the top of this do file*

*Recall that "Ideoldkn" is a dummy variable coded 0 if the respondent* 
*answers the ideological self-identification question either "don't know"*
*or "haven't thought about it much," and the variable is coded 1 if the*
*respondent ideologically self-identifies*

*Recall that the "Time" variable is coded as "0" for 1988 and increases* 
*by one to represent each election year thereafter, such that "6" corresponds* 
*to the year 2012*
****************	  	

summarize Ideoldkn if Time == 0
summarize Ideoldkn if Time == 1
summarize Ideoldkn if Time == 2
summarize Ideoldkn if Time == 3
summarize Ideoldkn if Time == 4
summarize Ideoldkn if Time == 5
summarize Ideoldkn if Time == 6

table Ideoldkn if Time == 0
table Ideoldkn if Time == 1
table Ideoldkn if Time == 2
table Ideoldkn if Time == 3
table Ideoldkn if Time == 4
table Ideoldkn if Time == 5
table Ideoldkn if Time == 6

****************	  	
*Calculate the proportion of "don't knows" for each year*
****************	  	

*1988*
di 610/2035
 
*1992*
di 656/2480

*1996*
di 383/1712

*2000*
di 193/866

*2004*
di 291/1211

*2008*
di 692/2318

*2012*
di 582/5882

****************	  	
*Assess the proportion of "don't knows" for 2012 respondents who were not*
*interviewed via the Internet*

*Note that VCF0017 is the ANES variable for interview mode, and category*
*4 is coded as an Internet survey*

*Note that because the response option "don't know" is not even available*
*in the online survey, removing respondents who were interviewed*
*via the Internet is the most realistic decision for the purposes*
*of this analysis*
****************	  	

summarize Ideology if VCF0004 == 2012 & VCF0017 != 4
table Ideology if VCF0004 == 2012 & VCF0017 != 4

di 582/2046

****************	  	
*The results of the above calculations are saved in a Stata data file*
*titled "Proportion of Don't Know Ideology Responses (1988-2012 ANES).dta*

*Note: Here, we use the results of the above calculations (contained in the*
*above Stata data file) to display the proportions of don't know responses*
*to the ideological self-identification question over time*

*Note: The following code produces Figure SI3*
****************

graph twoway (connect DKIdeology Year, ///
lcolor(black) mcolor(black) msize(small) ///
graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
plotregion(lcolor(black))graphregion(margin(medsmall)) /// 
xtitle(" ") ///
xlabel(1 "1988"  2 "1992" 3 "1996"  4 "2000" 5 "2004" 6 "2008" 7 "2012", /// 
labsize(small)) ///
yscale(range(0.2 0.1 0.4)) ///
ylabel(,format (%9.1f)) ///
ylabel(0.1(0.1)0.5, labsize(small) nogrid) ///
ytitle("Proportion Don't Know: Ideological Self-Identification", ///
size(medsmall)))

****************	  	
*In order to demonstrate further that removing from the analysis respondents* 
*who answer the ideological self-identification question either "don't know"* 
*or "haven't thought about it much" are not biasing our results, we specify*
*a Heckman selection model in which the outcome regression is identical*
*to that presented in manuscript Table 1, and the dependent variable in the*
*selection equation is the "Ideoldkn" dummy variable*
*Demographic variables, as well as the time variable, are included*
*as covariates in the selection equation*

*Note: The following code produces Table SI1*
****************	  	

heckman Partyid c.Ideology##c.Time##c.Valueorientations Retrospective ///
Retdem Dem Religiosity Black Hispanic Otherrace Gender Age Education Income ///
Married Union South, select(Ideoldkn = Time Black Hispanic Otherrace ///
Gender Age Education Income Married)

****************
*Investigate the potential concern that the Internet sample might affect* 
*the 2012 results, as no other year features Internet interviews*

*Note: Here, we respecify the main regression on our paper, featured*
*in manuscript Table 1, using the data saved in the Stata data file titled*
*"Values, Ideology and Partisanship, 1988-2012.data"*

*Again note that VCF0017 is the ANES variable for interview mode, and category*
*"4" is coded as an Internet survey*

*Note: The following code produces Table SI2*
****************

regress Partyid c.Ideology##c.Time##c.Valueorientations Retrospective ///
Retdem Dempres Religiosity Black Hispanic Otherrace Gender Age Education ///
Income Married Union South if Surveymode !=4

****************
*In order to assuage concerns that our value* 
*orientations scale might obscure important differences in the moderating* 
*effects of egalitarianism and moral traditionalism, respectively, on the*
*relationship between ideology and partisanship, we treat each core value* 
*separately in the models specified here*
****************

****************
*Egalitarianism*
*Note: The following code produces Figure SI4*
****************

*Create an egalitarianism scale constructed from the six individual indicators*
*of egalitarianism*

alpha Equalopp Equalrights Equalchance Unequal Lessequal Fewer, ///
detail item generate (Egalitarianismscale) casewise

*Recode the egalitarianism scale to range from 0 to 1*

replace Egalitarianismscale = Egalitarianismscale/4

*Regress partisanship on the same predictors as before, but with only*
*egalitarianism included in the three-way interaction that also includes*
*ideology and time*

regress Partyid c.Ideology##c.Time##c.Egalitarianismscale Retrospective ///
Retdem Dempres Religiosity Black Hispanic Otherrace Gender Age Education ///
Income Married Union South

*Estimate the marginal effect of ideology on partisanship over time*
*(i.e., across the time variable from 1988 (0) to 2012 (6), a total*
*of seven election years) conditioned on egalitarianism*

*Determine the relative cutoffs used to define egalitarian and*
*anti-egalitarian values*

summarize Egalitarianismscale

*We observe that the mean of the recoded egalitarianism scale is .3864364, and*
*the standard deviation is .2019174*

*Calculate egalitarian and anti-egalitarianism values*

di .3864364 - .2019174

di .3864364 + .209174

margins, dydx(Ideology) at(c.Time=(0(.01)6) ///
c.Egalitarianismscale=(.185(.342).596))

****************
*Create a marginal effects plot illustrating graphically the results obtained* 
*in the previous step of the analysis*
****************

marginsplot, recast(line) recastci(rspike) plot1opts(lcolor(black) /// 
lpattern(dash)) plot2opts(lcolor(black) lpattern(solid)) ///
ci1opts(color(navy) lwidth(vthin)) ///  
ci2opts(color(maroon) lwidth(vthin)) ///
xdimension(Time) aspectratio(.67) ///
legend(order(4 "Anti-egalitarianism values" ///
3 "Egalitarian values")) /// 
legend(pos(6)col(1)) legend(symysize(*.5)) legend(symxsize(*.5)) /// 
legend(size(small)) ///
graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
plotregion(lcolor(black))graphregion(margin(medsmall)) /// 
xlabel(0 "1988" 1 "1992" 2 "1996" 3 "2000" 4 "2004" 5 "2008" 6 "2012", ///
labsize(medsmall)) ///
xtitle("", size(medsmall)) ///
xscale(range(.9 6.1)) ///
ylabel (3.0(.5)4.5, labsize(medsmall) nogrid) ///
ytitle("M.E. of Ideology on Partisanship Conditioned on Egalitarianism", /// 
size(small)) ///
title("")

****************
*Moral traditionalism*
*Note: The following code produces Figure SI5*
****************

*Create a moral traditionalism scale constructed from the four individual* 
*indicators of moral traditionalism*

alpha Lifestyles Changing Family Standard, ///
detail item generate (Moralityscale) casewise

*Recode the moral traditionalism scale to range from 0 to 1*

replace Moralityscale = Moralityscale/4

*Regress partisanship on the same predictors as before, but with only*
*moral traditionalism included in the three-way interaction that also includes*
*ideology and time*

regress Partyid c.Ideology##c.Time##c.Moralityscale Retrospective ///
Retdem Dempres Religiosity Black Hispanic Otherrace Gender Age Education /// 
Income Married Union South

*Estimate the marginal effect of ideology on partisanship over time*
*(i.e., across the time variable from 1988 (0) to 2012 (6), a total*
*of seven election years) conditioned on moral traditionalism*

*Determine the relative cutoffs used to define socially progressive and* 
*morally traditional values*

summarize Moralityscale

*We observe that the mean of the recoded moral traditionalism scale* 
*is .5806158, and the standard deviation is .2166528*

*Calculate socially progressive and morally traditional values*

di .5806158 - .2166528

di .5806158 + .2166528

margins, dydx(Ideology) at(c.Time=(0(.01)6) ///
c.Moralityscale = (.364(.433).797))

****************
*Create a marginal effects plot illustrating graphically the results obtained* 
*in the previous step of the analysis*
****************

marginsplot, recast(line) recastci(rspike) plot1opts(lcolor(black) /// 
lpattern(dash)) plot2opts(lcolor(black) lpattern(solid)) ///
ci1opts(color(navy) lwidth(vthin)) ///  
ci2opts(color(maroon) lwidth(vthin)) ///
xdimension(Time) aspectratio(.67) ///
legend(order(4 "Morally traditional values" ///
3 "Culturally progressive values")) /// 
legend(pos(6)col(1)) legend(symysize(*.5)) legend(symxsize(*.5)) /// 
legend(size(small)) ///
graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
plotregion(lcolor(black))graphregion(margin(medsmall)) /// 
xlabel(0 "1988" 1 "1992" 2 "1996" 3 "2000" 4 "2004" 5 "2008" 6 "2012", ///
labsize(medsmall)) ///
xtitle("", size(medsmall)) ///
xscale(range(.9 6.1)) ///
ylabel (3.0(.5)4.5, labsize(medsmall) nogrid) ///
ytitle("M.E. of Ideology on Partisanship Conditioned on Moral Traditionalism", /// 
size(small)) ///
title("")

****************	
*In response to the concern that ideological self-identification*
*(symbolic ideology) is endogenous to partisanship, we specify here a model*
*examining potential over time changes in the effect of partisanship on*
*ideology conditioned on core values*

*Note, in the interest of being able to estimate comparably sized effects* 
*across the models in which partisanship and ideology are specified as the* 
*dependent variable, we recode the "Partyid" variable to range from "0" to "1"* 
*and recode the ideological self-identification variable to range*
*from "0" to "6"

*Note: The following code produces Table SI3*
****************	

replace Ideology = Ideology*6
replace Partyid = Partyid/6
 
regress Ideology c.Partyid##c.Time##c.Valueorientations Retrospective ///
Retdem Dem Religiosity Black Hispanic Otherrace Gender Age Education Income ///
Married Union South

****************	  	
*Here, we attempt to conduct the analysis correcting for measurement error by*
*constructing measures of latent core values, partisanship and ideology*
*Note: The following code produces Figure SI6*
****************

*We again recode partisanship to range from "0" to "6" for the*
*purpose of this analysis*

replace Partyid=Partyid*6

sem (SYMIDEOL -> Ideology Libtherm Conservtherm), nocapslatent latent(SYMIDEOL)
predict Ideolcfa, latent

sem (COREVALUES -> Equalopp Equalrights Equalchance Unequal Lessequal Fewer ///
Lifestyles Changing Family Standards), nocapslatent latent(COREVALUES)
predict Valuescfa, latent

sem (PID -> Partyid Dempartytherm Reppartytherm Demcandtherm ///
Repcandtherm), nocapslatent latent(PID)
predict Partyidcfa, latent

summarize Valuescfa
di .0007956 - .3444878
di .0007956 + .3444878
di .3452834 - -.3436922

regress Partyidcfa c.Ideolcfa##c.Time##c.Valuescfa Retrospective ///
Retdem Dempres Religiosity Black Hispanic Otherrace Gender Age Education ///
Income Married Union South if Ideolcfa !=0 | Partyidcfa !=0 | Valuescfa != 0

margins, dydx(Ideolcfa) at(c.Time=(0(.01)6) ///
c.Valuescfa = (-.3436922(.6889756).3452834))

****************
*Create a marginal effects plot illustrating graphically the results obtained* 
*in the previous step of the analysis*
****************

marginsplot, recast(line) recastci(rspike) plot1opts(lcolor(black) /// 
lpattern(dash)) plot2opts(lcolor(black) lpattern(solid)) ///
ci1opts(color(navy) lwidth(vthin)) ///  
ci2opts(color(maroon) lwidth(vthin)) ///
xdimension(Time) aspectratio(.67) ///
legend(order(4 "Latent conservative value orientations" ///
3 "Latent liberal value orientations")) /// 
legend(pos(6)col(1)) legend(symysize(*.5)) legend(symxsize(*.5)) /// 
legend(size(small)) ///
graphregion(fcolor(white)) graphregion(lpattern(blank)) ///
plotregion(lcolor(black))graphregion(margin(medsmall)) /// 
xlabel(0 "1988" 1 "1992" 2 "1996" 3 "2000" 4 "2004" 5 "2008" 6 "2012", ///
labsize(medsmall)) ///
xtitle("", size(medsmall)) ///
xscale(range(.9 6.1)) ///
ylabel (2.5(.5)4.5, labsize(medsmall) nogrid) ///
ytitle("M.E. of Ideology on Partisanship Conditioned on Values", /// 
size(small)) ///
title("")
